<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html ng-app="Manage">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title></title>
</head>
<link rel="stylesheet" type="text/css" href="/Public/css/index.css"/>
<link rel="stylesheet" type="text/css" href="/Public/css/nav.css"/>
<link rel="stylesheet" type="text/css" href="/Public/css/base.css"/>
<link rel="stylesheet" type="text/css" href="/Public/css/FileAction-index.css"/>

<link rel="stylesheet" type="text/css" href="/Public/css/FileAction-quickManage.css"/>
<link rel="stylesheet" type="text/css" href="/Public/bootstrap/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="/Public/Font-Awesome-3.2.1/css/font-awesome.min.css"/>
<style type="text/css">
	
</style>
<body ng-controller="TaskCtrl">
 <header>
<div class="nav-box">
	<div class="nav-nav">
		<div class="nav-nav-left">
			<a href=""><img class="logo" src="/Public/css/logo.svg" style="height: 47px;line-height: 47px; width: 90px; padding-left: 0.5em;float: left;"></a>
			<a href="/index.php/Home/share/index" class="item">分享</a>
			<!-- <a href="" class="item">帮助</a>
			<a href="" class="item">建议</a> -->
			<a href="javascript:;" class="finder_box">
					<div class="finder_input">
						<input type="text" class="finder" placeholder="搜索文件"/>	
					</div>
					<div class="finder_btn">
							<i class="icon-search"></i> 
					</div>
			</a>
		</div>
		<div class="nav-nav-right">
			<a href="/index.php/Home/index/edituserinfo">
					<img class="logo" src="<?php echo ($headimg); ?>" style="width: 40px;float: right;border-radius: 50%;margin-top:5px;">
			</a>
<!-- 			<a href="" class="item"><i class="icon-signout"></i></a>
			<a href="" class="item"><i class="icon-envelope"></i></a> -->
			<a href="/index.php/Home/FileAction/quickManage" class="item"><i class="icon-user"></i></a>
			<a href="/index.php/Home/UploadFile/index?#" class="item"><i class="icon-plus"></i></a>
		</div>
	</div>
</div>
</header> 
<div class="container" style="width: 1050px;margin:47px auto">
		<div class="row" >
				<div class="col-md-3">
					<div class="row">
							<div class="col-md-12 m-d-20">
								<div class="media ">
									  <a class="media-left" href="#">
												<img src="<?php echo ($headimg); ?>" class="face" >
									  </a>
									  <div class="media-body">
											<h4 class="media-heading"><?php echo ($nickname); ?></h4>
											<p>加入时间：<?php echo (date('Y-m-d',$addtime )); ?></p>
								  	</div>
								</div>
							</div>
					</div>
					<div class="row">
							<div class="col-md-12 m-d-10">
								<table style="width: 100%;">
									<tr>
										<td>
											<a href="/hlcxxx/followers">
												<div class="follow_num">
													<?php echo ($upload); ?>
													</div>
													<div class="follow_txt">
													Upload
													</div>
											</a>
										</td>
										<td>
											<a href="/hlcxxx/followers">
												<div class="follow_num">
													0
													</div>
													<div class="follow_txt">
													download
													</div>
											</a>
										</td>
										<td>
											<a href="/hlcxxx/followers">
												<div class="follow_num">
													0
													</div>
													<div class="follow_txt">
													Comments
													</div>
											</a>
										</td>
										
									</tr>
								</table>
							</div>
					</div>	
					<div class="row">
						<div class="col-md-12 m-d-20">
							<header id="user-info">
								<div class="user-info-title"><i class="icon-tags"></i>&nbsp;&nbsp;概览</div>
								<div class="user-info-content">
									<ul>
										<!--<li> 
											<a href="" class="content-name"><i class="icon-book"></i> 文献</a> 
											<a href="" class="content-number"> <span>12</span> </a>
										</li>
										
										<li> 
											<a href="" class="content-name"><i class="icon-book"></i> 文献</a> 
											<a href="" class="content-number"> <span>12</span> </a>
										</li>
										
										<li> 
											<a href="" class="content-name"><i class="icon-book"></i> 文献</a> 
											<a href="" class="content-number"> <span>12</span> </a>
										</li>
										
										<li> 
											<a href="" class="content-name"><i class="icon-book"></i> 文献</a> 
											<a href="" class="content-number"> <span>212</span> </a>
										</li>-->
									</ul>
								</div>
							</header>
						</div>
					</div>
				
				</div>
				 
				<div class="col-md-9">	
					<!-- ↓↓↓↓↓↓↓↓↓↓↓↓↓↓个性化代码区↓↓↓↓↓↓↓↓↓↓↓↓↓-->
					<div class="marklist-header">
							<div class="row">
								<div class="col-md-6"><h3>文件列表 -- ALL</h3>	</div>
								<div class="col-md-6" style="line-height: 56px;text-align: right;">
									<span style="font-size: 20px;font-weight: bold;">Communication</span>/
									<span style="font-size: 8px;">manage</span>
								</div>

						</div>
						
						
					</div>
					<!-- <div class="marklist">
						<a>标记:</a>
						<a href="" class="marker">ALL</a>
						<a href="" class="marker">营养</a>
						<a href="" class="marker">转基因</a>
						<a href="" class="marker">虫害</a>
						<a href="" class="marker">技术</a>
					 
					</div>

					<div class="marklist">
						<div class="row">
							<div class="col-md-6">
									<a>备注--</a>
						<input type="checkbox" />
					 <a>评论--</a>
						<input type="checkbox" />
							 <a>按时间排序--</a>
						<select name="">
							<option value="">升</option>
							<option value="">降</option>
						</select>
							</div>
							<div class="col-md-6" style="text-align: right;">
							文件太多不好管理?试试 <a href="">文件快速管理模式</a>吧					
							</div>
						</div>
					</div> -->
 
					<div class="filelist">
						<ul>
							 <li ng-repeat="i in list">
								<input type="checkbox" ng-model="i.checked" ng-change="selectOne()"  > 
								<a href="" class="filename">{{i.filename}} </a>
								<span class="uploadtime">{{i.datetime}}</span><!-- 标记：克隆  -->
								<a href="" ng-click="del(i)">删除</a>|<!-- <a href="">修改标记</a> -->
							</li>
						</ul>	
						
						 <label for="flag">全选
						     <input id="flag" type="checkbox" ng-model="select_all" ng-change="selectAll()">
						 </label>

						<br/><br/>
						<button class="btn btn-danger btn-xs" ng-click="delMore()">删除选中</button>		
					</div>
					<!-- ↑↑↑↑↑↑↑↑↑↑↑↑↑↑个性化代码区↑↑↑↑↑↑↑↑↑↑↑↑↑-->
				</div>				
		</div>
</div>


<footer>
	<div class="footer">
		
	</div>
	
</footer> 
</body>
<script src="/Public/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/Public/bootstrap/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
<script src="/Public/js/angular.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/Public/layer/layer.js" type="text/javascript" charset="utf-8"></script>

 <script type="text/javascript">

 		var app = angular.module('Manage',[]); //声明module
		app.controller('TaskCtrl',function($scope,$http){ //声明控制器

			$scope.list = <?php echo ($list); ?>;
		    $scope.checked = [];

		    $scope.selectAll = function () {
		        if($scope.select_all) {
		            $scope.checked = [];
		            angular.forEach($scope.list, function (i) {
		                i.checked = true;
		                $scope.checked.push(i.id);
		            })
		        }else {
		            angular.forEach($scope.list, function (i) {
		                i.checked = false;
		                $scope.checked = [];
		            })
		        }
		        console.log($scope.checked);
		    };
		     

		     $scope.selectOne = function () {
		        angular.forEach($scope.list , function (i) {
		            var index = $scope.checked.indexOf(i.id);
		            if(i.checked && index === -1) {
		                $scope.checked.push(i.id);
		            } else if (!i.checked && index !== -1){
		                $scope.checked.splice(index, 1);
		            };
		        })

		        if ($scope.list.length === $scope.checked.length) {
		            $scope.select_all = true;
		        } else {
		            $scope.select_all = false;
		        }
		        console.log($scope.checked);
		    }

			$scope.del = function(i){

				$http.post('<?php echo U('del');?>', i.id)
		        .success(function(data) {
		        	if(data.code == 0){
		        		layer.msg(data.msg,function(){
		        			location.reload();
		        		});
		        	}else{
		        		layer.msg(data.msg);
		        	}
		           
		        });

			},

			$scope.delMore = function(){

				$http.post('<?php echo U('delMore');?>', $scope.checked)
		        .success(function(data) {
		        	if(data.code == 0){
		        		layer.msg(data.msg,function(){
		        			location.reload();
		        		});
		        	}else{
		        		layer.msg(data.msg);
		        	}
		           
		        });
			}

		});


 </script>
</html>